Fix crash due to non-contiguous EMACS_INT (Bug#10780).
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 Feb 2012 23:09:58 +0000 (15:09 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 Feb 2012 23:09:58 +0000 (15:09 -0800)
commita40c73351c7aa2b990274122539a36fd3506cf79
tree3524d49e5f77746d456a75b68d9d6a7ba658fd75
parentc906e1d4e836d1b9aa68477f656d631206b632e3
Fix crash due to non-contiguous EMACS_INT (Bug#10780).

* lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
(USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
It's useless in that case, and it can cause problems on hosts
that allocate halves of EMACS_INT values separately.
Reported by Dan HorĂ¡k.  Diagnosed by Andreas Schwab in
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
* mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
it avoids undefined behavior on hosts where shifting right by more
than the word width has undefined behavior.
src/ChangeLog
src/lisp.h
src/mem-limits.h